﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.GamerServices;
using Microsoft.Xna.Framework.Input;

namespace Arena_Gangrena
{
    class c_Mouse
    {
        public Texture2D cursor_Texture;
        public Vector2 cursor_Position;


        public int frame;
        public bool Active;
        public int Width { get { return cursor_Texture.Width; } }
        public int Height { get { return cursor_Texture.Height; } }

        public void Init(Texture2D texture, MouseState position)
        {
            cursor_Texture = texture;
            cursor_Position.X = position.X;
            cursor_Position.Y = position.Y;
            Active = true;
        }
        
        public void Update(MouseState position_update) 
        {
            cursor_Position.X = position_update.X;
            cursor_Position.Y = position_update.Y;
        }
        
        public void Draw(SpriteBatch spriteBatch, GameTime gameTime)
        {
            frame = (int)(gameTime.TotalGameTime.TotalSeconds * 8) % 5;
            spriteBatch.Draw(cursor_Texture, cursor_Position, new Rectangle(frame * 32, 0, 32, 32), Color.White, 0.0f, new Vector2(0, 0), 1f, SpriteEffects.None, 0f);
        }
    }
}
